package com.spring.demo1;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class UserAction {

	public static void main(String[] args) {
		//1.加载spring配置文件，根据配置创建对象
				ApplicationContext context = (ApplicationContext) new ClassPathXmlApplicationContext("config.xml");
				//2.得到配置创建的对象
				UserService userService = (UserService) context.getBean("userService");
				userService.add();

	}

}
